<% @page_title = "Projects" %>

<%== part(
  "components/page_header",
  right_items: (@projects.count > 0) ? [
    part("components/button", text: "Create Project", link: "/project/create")
  ] : []
) %>

<div class="grid gap-6">
  <%== part(
      "components/table_card",
      headers: ["Name"],
      rows: @projects.map do |p|
         [
           [
             [p.name, {link: "#{p.path}/dashboard"}]
           ],
           { id: "project-#{p.ubid}" }
         ]
      end,
      empty_state: {
        icon: "hero-folder-open",
        title: "No projects",
        description: "Get started by creating a new project.",
        button_link: "/project/create",
        button_title: "Create Project"
      }
    ) %>
</div>
